package main

import (
	"Hypnos-Soundcore/controllers/common"
	_ "Hypnos-Soundcore/controllers/crontasks"
	_ "Hypnos-Soundcore/controllers/orders"
	"Hypnos-Soundcore/services/framework"
	"github.com/gin-gonic/gin"
)

func initController(engine *gin.Engine) {
	if engine != nil {
		v1 := engine.Group("/v1")
		controllers := common.GetControllers()
		for name := range controllers {
			c, ok := controllers[name]
			if ok && c != nil {
				c.InitEngineV1(engine)
				c.InitRouterGroupV1(v1)
			}
		}
	}
}

// @Version #version#
// @Title DidAuto API
// @Description This is a cron task server for Did Purchase system.
// @Schemes http
// @BasePath /v1
// @Name Anker
// @Contact ethan.sun@anker-in.com
// @URL https://community.anker.com/
// @TermsOfServiceUrl https://www.anker.com/
// @License Apache
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
// @Consumes json
// @Produces json
func main() {
	framework.MainEntry(initController)
}
